<template>
    <div>
        <div class="subtitle margin-top12">{{title}}</div>
        <!-- 高亮 -->
        <div @click="toDetails(item)" class="questionItem" v-for="(item,index) in questions" :key="index" v-html="`<div>${item.title.replace( new RegExp('('+searchValue+')','g'),'<font color=#377ef6>$1</font>')}<div>`"></div>
    </div>
</template>
<script>
export default({
    props: ['questions','title','searchValue'],
    methods: {
        toDetails(item) {
            this.$router.push({name : 'AnswerC', query: {answer: item.answer}})
        }
    },
})
</script>

<style lang="less" scoped>
@import '@/assets/style/style.less';
@import '@/assets/style/font.less';
@import '@/assets/style/color.less';
.questionItem{
    padding: 12px 0;
    color: @color_font_333;
    font-size: 14px;
    font-weight: 550;
}
</style>